<template>
    <el-dialog
            :title="dialogParams.title"
            :visible.sync="dialogParams.visible"
            :close-on-click-modal="false"
            width="35%">
        <el-form ref="formData" :model="formData" label-width="80px">
            <el-form-item label="审核意见">
                <el-input
                        type="textarea"
                        :autosize="{ minRows: 4, maxRows: 8}"
                        placeholder="请输入审核意见"
                        v-model.trim="formData.examineOpinion">
                </el-input>
            </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
            <el-button type="primary" @click="checkTarget(2)">{{ dialogParams.okText }}</el-button>
            <el-button type="warning" @click="checkTarget(3)">不通过</el-button>
            <el-button @click="dialogParams.visible = false">关 闭</el-button>
      </span>
    </el-dialog>
</template>

<script>
    export default {
        name: 'check',
        props: {
            dialogParams: {
                type: Object
            }
        },
        data () {
            return {
                formData: {
                    examineOpinion: '',
                }
            }
        },
        methods: {
            checkTarget(state){
                this.$emit('check', this.formData.examineOpinion, state)
            }
        }
    }
</script>

<style scoped>

</style>